import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
    routes:[
        {
            path: '/',
            name: 'Home',
            meta: { title: '首页' },
            component: () => import('@/views/index')
        }

    ]
})


router.beforeEach((to, from, next) => {
    document.title = to.meta && to.meta.title || ''
    next()
  })
  
  export default router